home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlib43 / mntlib / alarm.c < prev    next >
C/C++ Source or Header  |  1993-07-06  |  413b  |  28 lines

  1. /*
  2.  * alarm: a public domain alarm for MiNT (by ers)
  3.  */
  4.  
  5. #include <errno.h>
  6. #include <mintbind.h>
  7. #include <limits.h>
  8. #include <unistd.h>
  9.  
  10. extern int __mint;
  11.  
  12. unsigned int
  13. alarm(secs)
  14.     unsigned secs;
  15. {
  16.     long r;
  17.  
  18.     if (__mint == 0)
  19.         return 0;
  20. #ifndef __MSHORT__
  21.     if (secs > ((unsigned int) (LONG_MAX/1000)))
  22.         secs = ((unsigned int) (LONG_MAX/1000));
  23. #endif
  24.     r = Talarm((long) secs);
  25.  
  26.     return (unsigned int) r;
  27. }
  28.